//
//  DecoratorStream.h
//  DesignMode
//
//  Created by wangzhipan on 2024/9/11.
//

#import <Foundation/Foundation.h>
#import "IDecoratorStream.h"

/*
 Old中的问题解决思路：
 1、继承体系需要更改，stream类与 加密、解密、buffer等操作stream的分开继承基类IDecoratorStream; stream类与具体的操作不应该是父子类关系
 
 */


//stream 类直接实现IDecoratorStream
@interface DeFileStream: NSObject <IDecoratorStream>
@end

@interface DeMemoryStream : NSObject <IDecoratorStream>
@end

@interface DeNetworkStream : NSObject <IDecoratorStream>
@end


//具体操作类也直接实现IDecoratorStream，而不再继承stream类;
//扩展的操作，会持有对应的stream类，来进行对应操作
@interface DeEncryptStream : NSObject <IDecoratorStream>
@property(nonatomic, strong) id<IDecoratorStream>stream;
- (instancetype)initWithStream:(id<IDecoratorStream>)stream;
@end

@interface DeDecodeStream : NSObject <IDecoratorStream>
@property(nonatomic, strong) id<IDecoratorStream>stream;
- (instancetype)initWithStream:(id<IDecoratorStream>)stream;
@end

@interface DeBufferStream : NSObject <IDecoratorStream>
@property(nonatomic, strong) id<IDecoratorStream>stream;
- (instancetype)initWithStream:(id<IDecoratorStream>)stream;
@end
